<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <title>我的算力</title>
    <link rel="stylesheet" href="../../css/reset.css">
    <style>
        body {
            width: 100%;
            background-color: #f7f7f7;
            font-size: 0.28rem;
            height: auto;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            font-family: PingFangSC-Regular, sans-serif;
            color: #333333;
        }

        #types {
            width: 100%;
            height: auto;
            font-size: 0.3rem;
            text-align: center;
            background-color: #fff;
            position: sticky;
            position: -webkit-sticky;
            top: 0;
            left: 0;
        }

        #types>span {
            position: relative;
            color: rgba(137, 137, 137, 1);
            margin: 0.35rem 0.3rem 0rem 0.9rem;
            display: inline-block;
            padding-bottom: 0.2rem;
            line-height: 0.4rem;
        }

        #types>.active {
            color: #181818;
        }

        #types>span:first-child {
            margin-left: 0.3rem;
            margin-right: 0.9rem;
        }

        #types>.active:after {
            content: '';
            display: block;
            width: 40%;
            height: 0.06rem;
            background: #FFD203;
            border-radius: 0.04rem;
            bottom: 0;
            left: 30%;
            position: absolute;
        }

        .showheader {
            width: 6.9rem;
            height: 1.92rem;
            background: url("../../image/iconbgdfgx.png") no-repeat center;
            background-size: 100% 100%;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin-top: 0.3rem;
            margin-left: calc((100% - 6.9rem) / 2);
        }

        .showheader>p {
            font-size: 0.28rem;
            font-family: PingFang SC;
            font-weight: 500;
            color: #301405;
            margin-bottom: 0.14rem;
        }

        .incomeCoin {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            align-items: stretch;
            justify-content: center;
            padding: 0 0.4rem;
            box-sizing: border-box;
        }

        .incomeCoin>div {
            width: 50%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
        }

        .incomeCoin>div p {
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.28rem;
            font-family: PingFang SC;
        }

        .incomeCoin>div b {
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.32rem;
            font-weight: 400;
        }

        .bindFixed {
            padding-left: 0.9rem;
            box-sizing: border-box;
        }

        .showchoose {
            width: 100%;
            height: 0.5rem;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 0.2rem;
            padding: 0 0.3rem;
            box-sizing: border-box;
        }

        .showchoose b {
            width: 30%;
            height: 0.5rem;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-start;
            font-size: 0.32rem;
            font-family: PingFang SC;
            font-weight: bold;
            color: rgba(24, 24, 24, 1);
        }

        .showchoose p {
            width: 30%;
            height: 0.5rem;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: flex-end;
            font-size: 0.26rem;
            font-family: PingFang SC;
            font-weight: 500;
            color: rgba(137, 137, 137, 1);
        }

        .showDaysincome {
            width: 100%;
            height: auto;
            margin-top: 0.31rem;
        }

        #incomeList {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            padding: 0 0.31rem 0 0.27rem;
            box-sizing: border-box;
        }

        #incomeList li {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            box-sizing: border-box;
            background-color: #ffffff;
            padding: 0 0.23rem;
            padding-bottom: 0.25rem;
            margin-bottom: 0.16rem;
        }

        #incomeList li>p {
            width: 100%;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            box-sizing: border-box;
            margin-top: 0.25rem;
            margin-bottom: 0.3rem;
            font-size: 0.22rem;
            font-family: PingFang SC;
            font-weight: 500;
            color: rgba(137, 137, 137, 1);
        }

        #incomeList li>p>span:first-of-type {
            font-size: 0.28rem;
            font-family: Helvetica;
            font-weight: bold;
            color: rgba(24, 24, 24, 1);
        }

        #incomeList li div {
            width: 100%;
            flex: 1;
            display: flex;
            display: -webkit-flex;
            align-items: stretch;
            justify-content: flex-start;
            box-sizing: border-box;
            background-color: #ffffff;
        }

        #incomeList li div>p {
            width: 24%;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            box-sizing: border-box;
            background-color: #ffffff;
            font-size: 0.24rem;
            font-family: Helvetica;
            font-weight: 400;
            color: rgba(24, 24, 24, 1);
        }

        #incomeList li div>p:not(:first-of-type) {
            flex: 1;
        }

        #incomeList li div>p>span {
            margin-top: 0.1rem;
        }

        #incomeList li div>p>span:first-of-type {
            font-size: 0.2rem;
            font-family: PingFang SC;
            color: rgba(173, 173, 173, 1);
        }

        #incomeList li div>p:not(:first-of-type)>span:last-of-type {
            color: rgba(173, 173, 173, 1);
        }

        #incomeList li div>p:last-of-type {
            align-items: flex-end;
        }
    </style>
</head>

<body>
    <div id="types">
        <span class="active">BTC算力</span>
        <span>IPFS算力</span>
    </div>
    <div class="iframebg" style="display: none;">
    </div>
    <div class="showheader hideBtclass">
        <p>
            累计收益
        </p>
        <div class="incomeCoin">
            <div>
                <p>
                    <img src="../../image/iconasxx.png"
                        style="width: 0.3rem;height: 0.3rem;border-radius:0.08rem;margin-right: 0.1rem;"> BTC
                </p>
                <b class="btcprice">
                    0.00000000
                </b>
            </div>
            <div class="bindFixed" style="display: none;">
                <p>
                    <img src="../../image/bhpnewxa.png"
                        style="width: 0.3rem;height: 0.3rem;border-radius:0.08rem;margin-right: 0.1rem;"> BHP
                </p>
                <b class="bhpprice">
                    0.0000
                </b>
            </div>
        </div>
    </div>
    <div class="showchoose hideBtclass">
        <b>
            <!-- 挖矿收益 -->
        </b>
        <p class="goBhpayPage">
            双挖分币<img src="../../image/right_jintou.png" style="margin-left: 0.1rem;">
        </p>
    </div>
    <div class="showDaysincome hideBtclass">
        <ul id="incomeList">
            <!-- <li>
                <p>
                    <span>
                        <span>
                            BTC
                        </span>
                        <span style="font-weight: normal;color: rgba(173, 173, 173, 1);">
                            2020-01-13
                        </span>
                    </span>
                    <span style="color: #595959;">
                        查看详情<img src="../../image/right.png" style="width:0.11rem;margin-left: 0.06rem;">
                    </span>
                </p>
                <div>
                    <p>
                        <span>
                            总算力
                        </span>
                        <span>
                            0.00 T
                        </span>
                    </p>
                    <p>
                        <span>
                            总产出
                        </span>
                        <span>
                            +0.0000000 BTC
                        </span>
                        <span>
                            +0.0000 BHP
                        </span>
                        <span>
                            0.00 CNY
                        </span>
                    </p>
                    <p>
                        <span>
                            合约冻结
                        </span>
                        <span>
                            +0.0000000 BTC
                        </span>
                        <span>
                            +0.0000 BHP
                        </span>
                        <span>
                            0.00 CNY
                        </span>
                    </p>
                </div>
            </li> -->
        </ul>
        <div id="listState" style="width: 100%;text-align: center;padding: 0.2rem 0;"></div>
    </div>
    <script src="../../script/autosize.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/jquery_three_two_one.js"></script>
    <script src="../../script/dotmin.js"></script>
    <script src="../../script/app.js"></script>
    <script type="text/html" id="md">
        {{~it:value:index}}
        <li class="curLi" data-date="{{=value.incomeDate}}" data-totalProduce="{{=value.num}}">
            <p>
                <span>
                    <span>
                        BTC
                    </span>
                    <span style="font-weight: normal;color: rgba(173, 173, 173, 1);font-size:0.22rem;margin-left:0.1rem;">
                        {{=value.incomeDate}}
                    </span>
                </span>
                <span style="color: #595959;">
                    查看详情<img src="../../image/right.png" style="width:0.11rem;margin-left: 0.06rem;">
                </span>
            </p>
            <div>
                <p>
                    <span>
                        总算力
                    </span>
                    <span>
                        {{=value.incomePower}} T
                    </span>
                </p>
                <p>
                    <span>
                        合约冻结
                    </span>
                    <span>{{=value.insuranceFrozenIncomeNum}} BTC</span>
                    <span>￥{{=value.freeze_rmb}}</span>
                </p>
                <p>
                    <span>
                        总产出(含冻结)
                    </span>
                    <span>+{{=value.num}} BTC</span>
                    <span style="display:{{=value.bhpIncomeNum>0?'inline-block':'none'}};">+{{=value.bhpIncomeNum}} BHP</span>
                    <span>￥{{=value.total_price}}</span>
                </p>
            </div>
        </li>
        {{~}}
      </script>
    <script type="text/html" id="bhpINcome">
        {{~it:value:index}}
        <li>
            <p>
                {{=value.income_time}}
            </p>
            <div>
                <p>
                    BHP
                </p>
                <p>
                    <span>
                        {{=value.bhp}}
                    </span>
                    <span>
                    </span>
                </p>
                <p>
                    <span>+{{=value.btc_income}} BTC</span>
                    <span>￥ {{=value.totalIncome}}</span>
                </p>
            </div>
        </li>
        {{~}}
      </script>
    <script>
        apiready = function () {
            var app = new APP();
            app.handlePage();
            var currentPage = 1; //当前页面
            var totolPage = 0; //总页数
            var isOversea = api.pageParam.isOversea;//是否是海外
            var list = [];
            var btcPrice;
            var account = app.getAccount();
            var outBtcCoin = 0;
            var chooseType = "orinIncome";
            var loadPage = function () {
                app.ajaxPro({
                    url: "member/mining-income",
                    values: {
                        token: account.token
                    },
                    openFlower: true
                }, function (ret) {
                    if (ret.code == 200) {
                        var thisList = ret.data.lists;
                        $(".btcprice").text(app.sliceNum(ret.data.total_btc, 8));
                        // if (ret.data.total_bhp > 0) {
                        //     $(".showchoose").css({
                        //         marginTop: "1.2rem"
                        //     })
                        //     $(".bindFixed,.showBhp").show();
                        //     $(".bhpprice").text(app.sliceNum(ret.data.total_bhp, 8));
                        // }
                        thisList.map(function (item) {
                            item.incomePower = app.sliceNum(item.incomePower, 2);
                            item.insuranceFrozenIncomeNum = app.sliceNum(item.insuranceFrozenIncomeNum, 8);
                            item.num = app.sliceNum(item.num, 8);
                            item.bhpIncomeNum = app.sliceNum(item.bhpIncomeNum, 8);
                        });
                        var text = doT.template($("#md").text());
                        $("#incomeList").html(text(thisList));
                        $("#incomeList .curLi").unbind('click').click(function () {
                            var thiz = $(this);
                            var date = thiz.attr('data-date');
                            var itemData = thisList[thiz.index()];
                            app.openWin({
                                name: "produce_detail_headerwin",
                                url: app.hd + "common/headerwin.html",
                                pageParam: {
                                    subpage: "mine/produce_detail",
                                    name: "produce_detail",
                                    title: "产出详情",
                                    date: date,
                                    item: itemData,
                                }
                            });
                        })
                    }
                });
            };
            loadPage();
            var ipfsUrl = null;
            $("#types>span").click(function () {
                var curindex = $(this).index();
                $(this).addClass('active').siblings('span').removeClass('active');
                app.closeF("IPFS_framenew");
                if (curindex == 0) {
                    $(".hideBtclass").show();
                    $(".iframebg").hide();
                    loadPage();
                } else {
                    $(".hideBtclass").hide();
                    $(".iframebg").show();
                    var H = app.ST == "ios" ? app.accMul(1.85, app.htmlFs) : app.accMul(1.4, app.htmlFs);
                    app.ajaxPro({
                        url: "ipfs/calculate",
                        values: {
                            token: account.token
                        },
                        openFlower: true
                    }, function (ret) {
                        if (ret.code == 200) {
                            ipfsUrl = ret.data.url;
                            app.openFrame({
                                name: "IPFS_framenew",
                                url: ipfsUrl,
                                bgColor: "",
                                rect: {
                                    x: 0,
                                    y: H + app.safetyHeaderArea,
                                    w: app.W,
                                    marginBottom: app.safetyFooterArea
                                }
                            });
                        }
                    });
                }
            });
            $(".goBhpayPage").click(function () {
                app.ajaxPro({
                    url: "bhpay/get-bhplog",
                    values: {
                        token: account.token
                    },
                    openFlower: true
                }, function (ret) {
                    if (ret.code == 200) {
                        var param = {
                            dtype: "dialog41"
                        };
                        app.dialog(param);
                        setTimeout(function () {
                            app.closeF("dialog");
                            // var param = {
                            //     name: "BHPayBorser",
                            //     url: ret.data,
                            //     title: "双挖分币",
                            //     param: {
                            //         openBHpay: 'true'
                            //     }
                            // }
                            // app.setNavBarAttrPrimary(param);
                            app.openWin({
                                name: "browser_headerwin",
                                url: app.hd + "common/headerwin.html",
                                pageParam: {
                                    subpage: ret.data,
                                    name: "browser_headerwin",
                                    type: "remote",
                                    isremote: "true",
                                    title: "双挖分币",
                                    openBHpay: 'true'
                                }
                            });
                        }, 1500);

                    } else {
                        app.toast(ret.message);
                    }
                })
            });
            // app.downRefresh(function () {
            //     $("body").scrollTop(0);
            //     $("#daysIncomeList,#incomeList").empty();
            //     $("#types>span").eq(0).click();
            //     if (chooseType == "orinIncome") {
            //         loadPage();
            //     }
            // });
            $("#helpdetail").click(function (e) {
                var param = {
                    dtype: "dialog30",
                    forceNumber: outBtcCoin
                };
                app.dialog(param);
            });
            app.headerMap(function (ret) {
                var cointypecontract = {
                    page: "common/headerwin",
                    name: "myincom_headerwin",
                    param: {
                        subpage: "mine/myincom",
                        name: "myincom",
                        allowEdit: true,
                        isOpenMyincome: "true"
                    }
                };
                var recoinNumber = JSON.stringify(cointypecontract);
                app.goPushPage(recoinNumber);
            });
        };
    </script>
</body>

</html>